package Model;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;

public class Mixes 
{
	List<Mix> m_Mixes;

	public Mixes()
	{
		m_Mixes = new ArrayList<Mix>();
		
		try {
			
			List<String> lines = Files.readAllLines(Paths.get("src/mixes.txt"), Charset.defaultCharset());
			
			for (String line : lines) {
				
				String[] params = line.split(" ");
				
				m_Mixes.add(new Mix(params[0], params[1], params[2]));
			}
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public Stack<Mix> get(Integer... indexes) 
	{
		Stack<Mix> sublist = new Stack<Mix>();
		
		for (Integer index : indexes) {
			sublist.add(m_Mixes.get(index));
		}
		
		return sublist;
	}
	
}
